package com.neu.flashmall.product.controller;

import com.neu.common.utils.Result;
import com.neu.flashmall.product.entity.PmsCategoryBrand;
import com.neu.flashmall.product.service.PmsCategoryBrandService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/pms_categoryBrand")
public class PmsCategoryBrandController {

    @Resource
    private PmsCategoryBrandService pmsCategoryBrandService;

    @GetMapping("/getByCategory")
    public Result getByCategory(Long categoryId){
        List<PmsCategoryBrand> all = pmsCategoryBrandService.getByCategory(categoryId);
        return Result.ok().put(all);
    }
}
